load("@rules_jvm_external//:defs.bzl", "artifact")
load("//:common_defs.bzl", "androidxLibVersion", "coreVersion", "espressoVersion", "extJUnitVersion", "extTruthVersion", "rulesVersion", "runnerVersion")

licenses(["notice"])  # Apache 2.0

android_library(
    name = "test_deps",
    visibility = ["//visibility:public"],
    exports = [
        artifact("androidx.annotation:annotation"),
        artifact("androidx.test.espresso:espresso-core"),
        artifact("androidx.test:rules"),
        artifact("androidx.test:runner"),
        artifact("androidx.test:monitor"),
        artifact("androidx.test.ext:junit"),
        artifact("androidx.test:core"),
        artifact("com.google.guava:guava"),
        artifact("com.google.inject:guice"),
        artifact("javax.inject:javax.inject"),
        artifact("junit:junit"),
        artifact("org.hamcrest:java-hamcrest"),
    ],
)

# Platform configuration for emulators on RBE for Bazel CI
platform(
    name = "android_platform",
    constraint_values = [
        "@bazel_tools//platforms:x86_64",
        "@bazel_tools//platforms:linux",
        "@bazel_toolchains//constraints:xenial",
        "@bazel_tools//tools/cpp:clang",
    ],
    # TODO(@jin): s/di-cloud-exp/rbe-containers/ when the official android-test container with libxcursor1 and libxcomposite1 is ready.
    # URI for official container: docker://gcr.io/rbe-containers/ubuntu16_04-android_test@sha256:<sha256>
    remote_execution_properties = """
        properties: {
            name: "container-image"
            value: "docker://gcr.io/di-cloud-exp/rbe-ubuntu16-04-android@sha256:eb3828f71faf595f44b20b97d205e73e8a21982f1d7a170c3ec8f9d33ce3179a"
        }
        properties: {
            name: "dockerNetwork"
            value: "standard"
        }
        properties: {
            name: "dockerPrivileged"
            value: "true"
        }
        properties: {
            name: "gceMachineType"
            value: "n1-standard-2"
        }
""",
)
